// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SALES_APP_ITEM
// * CreateDate    : 2014-03-27 22:08:53
// * Creater       : CodeSmith
// * LastChangeDate: 2014-03-27 22:08:53
// * LastChanger   : 2014-03-27 22:08:53
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Suzsoft.Smart.Data;
using ESOL.Common.Entity;

namespace ESOL.Business.Sales
{
/// <summary>
    /// SalesAppItem
    /// </summary>
    public partial class SalesAppItemBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objSalesAppItemEntity">Entity</param>
        /// <returns>Entity</returns>
        public static SalesAppItemEntity GetSalesAppItem(SalesAppItemEntity objSalesAppItemEntity)
        {
            return DataAccess.SelectSingle<SalesAppItemEntity>(objSalesAppItemEntity);
        }
        #endregion


        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objSalesAppItemEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertSalesAppItem(SalesAppItemEntity objSalesAppItemEntity)
        {
            return DataAccess.Insert(objSalesAppItemEntity);
        }

        public static bool InsertSalesAppItem(List<SalesAppItemEntity> objSalesAppItemEntityList)
        {
            return DataAccess.Insert(objSalesAppItemEntityList);
        }
        #endregion


        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objSalesAppItemEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateSalesAppItem(SalesAppItemEntity objSalesAppItemEntity)
        {
            return DataAccess.Update(objSalesAppItemEntity);
        }

        public static bool UpdateSalesAppItem(List<SalesAppItemEntity> objSalesAppItemEntityList)
        {
            return DataAccess.Update<SalesAppItemEntity>(objSalesAppItemEntityList);
        }
        #endregion


        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objSalesAppItemEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteSalesAppItem(SalesAppItemEntity objSalesAppItemEntity)
        {
            return DataAccess.Delete(objSalesAppItemEntity);
        }

        public static bool DeleteSalesAppItem(List<SalesAppItemEntity> objSalesAppItemEntityList)
        {
            return DataAccess.Delete<SalesAppItemEntity>(objSalesAppItemEntityList);
        }
        #endregion


        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetSalesAppItemAll()
        {
            return DataAccess.SelectAllDataSet<SalesAppItemEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<SalesAppItemEntity> GetSalesAppItemAllList()
        {
            return DataAccess.SelectAll<SalesAppItemEntity>();
        }
        #endregion

        public static DataSet GetAllDsByAppId(string appId)
        {
            if (string.IsNullOrEmpty(appId))
                return null;
            string sql = @"select * from SALES_APP_ITEM where APP_ID='{0}'";
            sql = string.Format(sql,appId);
            return DataAccess.SelectDataSet(sql);

        }

	}
	
	
}	

